html,
body {
    /* Desktop letterboxing must blend with the dialogue-focus tint instead of
       exposing bare black whenever the native 816×624 viewport is centered. */
    background-color: #173437;
    width: 100%;
    height: 100%;
    margin: 0;
    overflow: hidden;
    overscroll-behavior: none;
    touch-action: none;
}
body {
    -moz-user-select: none;
    -webkit-user-select: none;
    -ms-user-select: none;
    user-select: none;
}
.mb-game-shell {
    background-color: #173437;
    background-image:
        linear-gradient(90deg, rgba(168, 199, 183, 0.055) 1px, transparent 1px),
        linear-gradient(0deg, rgba(168, 199, 183, 0.055) 1px, transparent 1px);
    background-size: 16px 16px;
}
#errorPrinter {
    position: absolute;
    left: 50%;
    top: 50%;
    width: 640px;
    height: 100px;
    transform: translate(-50%, -50%);
    text-align: center;
    text-shadow: 1px 1px 3px #000;
    font-size: 20px;
    color: #fff;
    z-index: 9;
}
#errorName {
    color: #ff0;
    font-weight: bold;
    -moz-user-select: text;
    -webkit-user-select: text;
    -ms-user-select: text;
    user-select: text;
}
#errorMessage {
    color: #fff;
    -moz-user-select: text;
    -webkit-user-select: text;
    -ms-user-select: text;
    user-select: text;
}
#retryButton {
    font-size: 20px;
    color: #fff;
    background-color: #000;
    border-radius: 8px;
    margin: 20px;
    padding: 10px;
}
#fpsCounterBox {
    position: absolute;
    left: 5px;
    top: 5px;
    width: 90px;
    height: 40px;
    background: #222;
    opacity: 0.8;
    z-index: 8;
}
#fpsCounterLabel {
    position: absolute;
    top: 0px;
    left: 0px;
    padding: 5px 10px;
    height: 30px;
    line-height: 32px;
    font-size: 12px;
    font-family: rmmz-numberfont, sans-serif;
    color: #fff;
    text-align: left;
}
#fpsCounterNumber {
    position: absolute;
    top: 0px;
    right: 0px;
    padding: 5px 10px;
    height: 30px;
    line-height: 30px;
    font-size: 24px;
    font-family: rmmz-numberfont, monospace;
    color: #fff;
    text-align: right;
}
#loadingSpinner {
    margin: auto;
    position: absolute;
    top: 0px;
    left: 0px;
    right: 0px;
    bottom: 0px;
    width: 120px;
    height: 120px;
    z-index: 10;
}
#loadingSpinnerImage {
    margin: 0px;
    padding: 0px;
    border-radius: 50%;
    width: 96px;
    height: 96px;
    border: 12px solid rgba(255, 255, 255, 0.25);
    border-top: 12px solid rgba(255, 255, 255, 1);
    animation: fadein 2s ease, spin 1.5s linear infinite;
}
@keyframes fadein {
    0% {
        opacity: 0;
    }
    20% {
        opacity: 0;
    }
    100% {
        opacity: 1;
    }
}
@keyframes spin {
    0% {
        transform: rotate(0deg);
    }
    100% {
        transform: rotate(360deg);
    }
}

/* Android-only map controls. The plugin positions them inside the fitted canvas. */
#mcp-android-control-pad {
    position: fixed;
    z-index: 10;
    opacity: var(--pad-opacity);
    touch-action: none;
    user-select: none;
    -webkit-tap-highlight-color: transparent;
}
#mcp-android-control-pad[hidden] { display: none; }
#mcp-android-control-pad .mcp-stick-surface {
    position: relative;
    display: block;
    box-sizing: border-box;
    width: 100%;
    height: 100%;
    margin: 0;
    padding: 0;
    border: 3px solid var(--pad-edge);
    border-radius: 50%;
    background: var(--pad-paper);
    box-shadow: 0 3px 0 var(--pad-shadow);
    touch-action: none;
    outline: none;
}
#mcp-android-control-pad .mcp-stick-surface::before {
    content: "";
    position: absolute;
    inset: 12%;
    border: 2px solid var(--pad-edge);
    border-radius: 50%;
    opacity: 0.45;
    pointer-events: none;
}
#mcp-android-control-pad .mcp-stick-knob {
    position: absolute;
    box-sizing: border-box;
    left: 50%;
    top: 50%;
    width: var(--stick-thumb);
    height: var(--stick-thumb);
    border: 3px solid var(--pad-ink);
    border-radius: 50%;
    background: var(--pad-paper);
    box-shadow: 0 3px 0 var(--pad-shadow);
    transform: translate(calc(-50% + var(--stick-x, 0px)), calc(-50% + var(--stick-y, 0px)));
    transition: transform 90ms ease-out;
    pointer-events: none;
}
#mcp-android-control-pad .mcp-stick-knob::after {
    content: "";
    position: absolute;
    left: 50%;
    top: 50%;
    width: 4px;
    height: 4px;
    background: var(--pad-ink);
    border-radius: 50%;
    transform: translate(-50%, -50%);
    box-shadow: -9px 0 0 var(--pad-ink), 9px 0 0 var(--pad-ink);
}
#mcp-android-control-pad .is-pressed .mcp-stick-knob {
    border-color: var(--pad-pressedEdge);
    background: var(--pad-pressed);
    box-shadow: 0 1px 0 var(--pad-shadow);
    transition: none;
}
@media (prefers-reduced-motion: reduce) {
    #mcp-android-control-pad .mcp-stick-knob { transition: none; }
}

#mcp-android-action-buttons {
    pointer-events: none;
    position: fixed;
    z-index: 10;
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    opacity: var(--pad-opacity);
    touch-action: none;
    user-select: none;
    -webkit-tap-highlight-color: transparent;
}
#mcp-android-action-buttons[hidden] { display: none; }
#mcp-android-action-buttons button {
    pointer-events: auto;
    display: grid;
    place-items: center;
    box-sizing: border-box;
    width: var(--action-size);
    height: var(--action-size);
    margin: 0;
    /* Power Green's ink sits 7px below and 1px left of its line center.
       Balance the ink, not the font box, without moving the round hit area. */
    padding: 0 0 14px 2px;
    border: 2px solid var(--pad-edge);
    border-radius: 50%;
    color: var(--pad-ink);
    background: var(--pad-paper);
    box-shadow: 0 3px 0 var(--pad-shadow);
    font: 24px MBPokemonDialogue, sans-serif;
    line-height: 1;
    touch-action: none;
    outline: none;
}
#mcp-android-action-buttons button[data-action="b"] { margin-top: var(--action-rise); }
#mcp-android-action-buttons button.is-pressed {
    border-color: var(--pad-pressedEdge);
    background: var(--pad-pressed);
    box-shadow: 0 1px 0 var(--pad-shadow);
}
#mcp-android-action-buttons button.is-disabled { opacity: 0.35; }
